﻿@using Model.User;
@{
    Layout = null;

    var model = GetModel<UserModel>("user");
}

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
          "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <!-- header page -->
    @Html.Partial(IncludePath("header"))
</head>

<body>
    @Html.Partial(IncludePath("body_top"))
    @Html.Partial(IncludePath("nav"))

    <div class="container" style="margin-top:20px;">
        <div class="row">
            <div class="col-md-9">
                <div class="box">
                    <form id="fm">
                        <table class="table table-responsive">
                            <thead>
                                <tr>
                                    <td style="width:20%;"></td>
                                    <td style="width:80%;"></td>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <td class="active"></td>
                                    <td>
                                        <a href="/user/updateusermask/" target="_self">
                                            <img src="/user/usermask/@(model.UID)/" alt="修改头像" class="circle_radius" style="width:100px;height:100px;" />
                                        </a>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active">用户昵称：</td>
                                    <td><input name="user_name" type="text" class="form-control" value="@(model.NickName)" /></td>
                                </tr>
                                <tr>
                                    <td class="active">邮件地址：</td>
                                    <td>@(model.Email)</td>
                                </tr>
                                <tr>
                                    <td class="active">性别：</td>
                                    <td>
                                        <select name="user_sex" data-value="@(model.Sex)" class="form-control" style="display:block;width:200px;">
                                            <option value="1">男</option>
                                            <option value="0">女</option>
                                        </select>
                                    </td>
                                </tr>
                                <tr>
                                    <td class="active">联系电话：</td>
                                    <td><input name="user_phone" type="text" class="form-control" value="@(model.Phone)" /></td>
                                </tr>
                                <tr>
                                    <td class="active">QQ：</td>
                                    <td><input name="user_qq" type="text" class="form-control" value="@(model.QQ)" /></td>
                                </tr>
                                <tr>
                                    <td class="active">个人说明：</td>
                                    <td><textarea name="user_introduction" cols="50" rows="5" class="form-control">@(model.Introduction)</textarea></td>
                                </tr>
                            </tbody>
                        </table>
                        <div class="col-md-12">
                            <div class="pull-right" style="padding:30px 0;">
                                <button type="submit" class="btn btn-primary">保存</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
            <div class="col-md-3">
                @Html.Partial(IncludePath("user_menu"))
            </div>
        </div>
    </div>
    <script type="text/javascript">
        $(function () {

            var form = $('#fm');
            form.submit(function () {

                var data = $(this).serializeArray();

                postJson('/user/infoaction/', data, function (res) {
                    if (res && res.success) {
                        alert('保存成功');
                        window.location.reload();
                    }
                    else {
                        alert(res.msg);
                    }
                });

                return false;
            });

        });
    </script>

    @Html.Partial(IncludePath("body_bottom"))

</body>
</html>
